﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ASBCC.Workflow.K2Manager;

namespace BEGDC.CC.Web.Workflow.Dialog
{
    public partial class ExecuteWithComments : BasePage
    {
        Dictionary<string, string> _actionTypeResources;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                hidCommentRequired.Value = Resources.Workflow.CommentRequired;
                string actionTypeValue = _actionTypeResources[ActionType];
                btnExecute.Text = actionTypeValue;
            }
        }

        protected override void OnInit(EventArgs e)
        {
            _actionTypeResources = new Dictionary<string, string>();
            _actionTypeResources.Add(K2ActionType.Submit, Resources.Workflow.Submit);
            _actionTypeResources.Add(K2ActionType.Resubmit, Resources.Workflow.Resubmit);
            _actionTypeResources.Add(K2ActionType.Approve, Resources.Workflow.Approve);
            _actionTypeResources.Add(K2ActionType.Reject, Resources.Workflow.Reject);
            _actionTypeResources.Add(K2ActionType.Review, Resources.Workflow.Review);
            _actionTypeResources.Add(K2ActionType.Forward, Resources.Workflow.Forward);
            _actionTypeResources.Add(K2ActionType.ForwardBack, Resources.Workflow.ForwardBack);
            _actionTypeResources.Add(K2ActionType.ReplyForwardBack, Resources.Workflow.ReplyForwardBack);
            _actionTypeResources.Add(K2ActionType.AskForMore, Resources.Workflow.AskForMore);
            _actionTypeResources.Add(K2ActionType.ReplyAskForMore, Resources.Workflow.ReplyAskForMore);
            _actionTypeResources.Add(K2ActionType.Discard, Resources.Workflow.Discard);
            _actionTypeResources.Add(K2ActionType.Drawback, Resources.Workflow.Drawback);
            _actionTypeResources.Add(K2ActionType.Withdraw, Resources.Workflow.Withdraw);
            _actionTypeResources.Add(K2ActionType.Close, Resources.Workflow.Close);
            _actionTypeResources.Add(K2ActionType.Save, Resources.Workflow.Save);
            _actionTypeResources.Add(K2ActionType.Edit, Resources.Workflow.Edit);
            _actionTypeResources.Add(K2ActionType.Log, Resources.Workflow.Log);
            _actionTypeResources.Add(K2ActionType.Comment, Resources.Workflow.Comment);
            _actionTypeResources.Add(K2ActionType.Print, Resources.Workflow.Print);
            _actionTypeResources.Add(K2ActionType.Upload, Resources.Workflow.Upload);
            _actionTypeResources.Add(K2ActionType.Validate, Resources.Workflow.Validate);
            //Added by GJ 2011-6-21 
            _actionTypeResources.Add(K2ActionType.Acknowledge, Resources.Workflow.Acknowledge);

            base.OnInit(e);
        }

        public string ActionType
        {
            get { return Request.QueryString["ActionType"]; }
        }
    }
}